package service
import (
	"html/template"
	"net/http"

	"github.com/unrolled/render"
)
func loginHandler(formatter *render.Render) http.HandlerFunc {

	return func(w http.ResponseWriter, req *http.Request) {
		formatter.HTML(w, http.StatusOK, "login", struct {}{})
	}
}

func submit(w http.ResponseWriter, req *http.Request) {
	req.ParseForm()
	usr := req.Form["username"][0]
	pwd := req.Form["password"][0]
	page := template.Must(template.New("form.html").ParseFiles("./templates/form.html"))
	page.Execute(w, map[string]string{
		"usr":  usr,
		"pwd":  pwd,
	})
}